<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>注册</title>
	<link rel="stylesheet" href="/css/common.css">
	<link rel="stylesheet" href="/css/register.css">
</head>
<body class="register">
	<div>
		<div class="register-center" style="position:relative">
			<div class="register-logo"></div>
			<div class="register-title">欢迎使用分针</div>
			<form action="{:url('Index/index')}" method="post" >
				<input class="register-input" type="text" name="username" id="username" placeholder="请输入您的手机号码">
				<input class="register-input" type="password" name="password" id="password" placeholder="请输入您的密码">
				<input class="register-input" type="password" name="confirm" id="confirm" placeholder="请输入您的验证码">
				<a  id= "yzm" class="yzm" href="#" onclick="time2()" >发送验证码</a>
				<input class="register-btn" value="注册" name="Submit" type="Submit">
			</form>
			<div class="register-foot">
				<span class="register-foot-1">已有分针号?</span>
				<a href="{:url('Index/login')}" class="register-foot-2">立即登录</a>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
	<script type="text/javascript">
	$('#username').blur(function(){
    var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
    if(!myreg.test($("#username").val()))
    {
        alert('请输入有效的手机号码！');
        return false;
    }
		});
function time2(){
var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
if(!myreg.test($("#username").val())){
	alert('请输入有效的手机号码！');
}else{
var wait=60; 
var time3=window.setInterval(function (){
		if(wait >0){
		wait--;
		$('#yzm').html(wait);
	}else{
		$('#yzm').html('发送验证码');
		window.clearInterval(time3);
	}
},1000);
                                  }
		}
</script>
</body>
</html>
